import request from "./request.js"
import api from "./api.js"

// -----------------------------------------------------------工具类start------------------------------------
// 查询学历表所有记录
function get_education_list(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.getEducationList,
		method: 'GET',
		data: params
	})
}
// 获取简历信息
function get_resume_info(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.getResumeInfo,
		method: 'GET',
		data: params
	})
}
// // 获取学历情况
// function get_education_list(params){
// 	return new request.tokenRequest({
// 		url: api.data.requestUrl + api.data.educationList,
// 		method: 'GET',
// 		data: params
// 	})
// }
// 上传oss
function uploadOss(isPublic = true, isHttps = true){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.uploadOssFile,
		method: 'GET',
		data:{
			isPublic,
			isHttps		
		}
	})
}
// -----------------------------------------------------------工具类end----------------------------------------
// -----------------------------------------------------------教育经历start------------------------------------
// 添加教育经历
function add_education_experience(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.addEcucationExperience,
		method: 'POST',
		data: params
	})
}
// 查询教育经历
function check_education_experience(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.checkEducationExperience,
		method: 'GET',
		data: params
	})
}
// 修改教育经历
function edit_education_experience(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.editEducationExperience,
		method: 'POST',
		data: params
	})
}

// 根据编号删除教育经历
function del_education_experience_byId(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.delEducationExperience,
		method: 'GET',
		data: params
	})
}
// -----------------------------------------------------------教育经历end----------------------------------------
// -----------------------------------------------------------工作经历start--------------------------------------
// 新增工作经历
function add_work_experience(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.addWorkExperience,
		method: 'POST',
		data: params
	})
}
// 删除工作经历
function del_work_experience_byId(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.delWorkExperience,
		method: 'GET',
		data: params
	})
}
// 修改工作经历
function edit_work_experience(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.editWorkExperience,
		method: 'POST',
		data: params
	})
}
// 查工作经历
function check_work_experience_byId(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.checkWorkExperience,
		method: 'GET',
		data: params
	})
}
// -----------------------------------------------------------工作经历end--------------------------------------
// -----------------------------------------------------------添加删除证书start--------------------------------
// 添加证书
function add_teacher_certificate(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.addTeacherCertificate,
		method: 'POST',
		data: params
	})
}
//删除证书
function del_teacher_certificate(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.delTeacherCertificate,
		method: 'GET',
		data: params
	})
}
// -----------------------------------------------------------添加删除证书end--------------------------------------
// -----------------------------------------------------------个人资料管理start-------------------------------------
// 新增用户资料
function add_user_info(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.addUserProfile,
		method: 'POST',
		data: params
	})
}
// 修改用户资料
function edit_user_info(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.editUserProfile,
		method: 'POST',
		data: params
	})
}
// 根据用户查询资料
function check_user_info(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.checkUserProfile,
		method: 'GET',
		data: params
	})
}
// -----------------------------------------------------------个人资料管理end------------------------------------
// -----------------------------------------------------------我的发起/邀请start--------------------------------------
// 我的发起列表
function my_send(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.mySendList,
		method: 'GET',
		data: params
	})
}
// 我的邀请列表
function my_invite(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.myInvited,
		method: 'GET',
		data: params
	})
}
// 单位邀请列表
function unit_invite(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.unitInvited,
		method: 'GET',
		data: params
	})
}
// 单位邀请列表
function teacher_send(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.teacherSendList,
		method: 'GET',
		data: params
	})
}
// 消息列表
function get_myCount(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.getMyCountTeacher,
		method: 'GET',
		data: params
	})
}
//推送列表
function get_service_list(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.serviceList,
		method: 'GET',
		data: params
	})
}
// ----------------------------------------------------------- 我的发起/邀请end --------------------------------------
// ----------------------------------------------------------- 入驻机构相关start --------------------------------------
// 通过关键字搜索机构
function search_org(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.searchOrg,
		method: 'GET',
		data: params
	})
}
// ----------------------------------------------------------- 入驻机构相关end --------------------------------------
// 发送短信验证码到校长手机号
function send_message_to_rector(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.sendMessage,
		method: 'GET',
		data: params
	})
}
// 用户绑定单位
function bind_business_company(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.bindBusiness,
		method: 'POST',
		data: params
	})
}
// 判断手机验证码是否正确
function is_validate_corrgite(params) {
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.isValidate,
		method: 'POST',
		data: params
	})
}
// 记录下次登录状态
function save_login_identity(params){
	return new request.tokenRequest({
		url: api.data.requestUrl + api.data.chooseLoginIdentity,
		method: 'GET',
		data: params
	})
}


module.exports = {
	get_education_list,
	add_education_experience,
	get_resume_info,
	check_education_experience,
	edit_education_experience,
	del_education_experience_byId,
	add_work_experience,
	del_work_experience_byId,
	edit_work_experience,
	check_work_experience_byId,
	uploadOss,
	add_teacher_certificate,
	del_teacher_certificate,
	my_send,
	my_invite,
	unit_invite,
	teacher_send,
	add_user_info,
	edit_user_info,
	check_user_info,
	search_org,
	send_message_to_rector,
	bind_business_company,
	is_validate_corrgite,
	save_login_identity,
	get_myCount,
	get_service_list
}